Test Series - java script

Test Number 64/92

Q: How many parameters does the WebPageTest API accept?
A. 5
B. 6
C. 7
D. 8
Solution: WebPageTest helps you run a free website speed test from multiple locations around the globe using real browsers (IE and Chrome) and at real consumer connection speeds. The WebPageTest API accepts totally 8 parameters, namely url, location, runs, fvonly, private, block, f, k.
Q: What is the purpose of getting the parameter block?
A. Permission to block
B. Space separated block list
C. Comma separated block list
D. Underscore separated block list
Solution: A ParameterBlock encapsulates all the information about sources and parameters (Objects) required by a RenderableImageOp, or other classes that process images. This parameter allows you to set a comma separated list of block options.
Q: What will happen if you set the private flag as 1?
A. Test will be run only by the administrator
B. Test will not be run
C. Test is public
D. Test is not displayed in public
Solution: The WebPageTest results provide rich diagnostic information including resource loading waterfall charts, Page Speed optimization checks and suggestions for improvements which can be kept public or private. Setting the private flag to 1 will make sure that the test is not displayed in the public list of tests.
Q: What is the purpose of getting the parameter fvonly?
A. To repeat the view test
B. To get the first view
C. To debug the code
D. To compile the code
Solution: fvonly is an optional parameter which is set to 1 to skip the Repeat View test. If you set fvonly to 1, you get results only for the first view and do not run the repeat view test.
Q: What is the purpose of the file_get_contents()?
A. To get the errors and exceptions
B. To get the client’s response
C. To get the server’s response
D. To get the data
Solution: The file_get_contents() is a PHP’s native function used to hit the URL and read the server’s response into
a variable $wpt_response:
$wpt_response = file_get_contents($wpt_url . $urls_to_benchmark[$x]);
This function is similar to file(), except that file_get_contents() returns the file in a string, starting at the specified offset up to maxlen bytes. On failure, file_get_contents() will return FALSE.
Q: What will the file_get_contents() return?
A. Server’s response
B. Errors
C. Exception
D. Client’s response
Solution: The file_get_contents() is a PHP’s native function used to hit the URL and read the server’s response into
a variable $wpt_response:
$wpt_response = file_get_contents($wpt_url . $urls_to_benchmark[$x]);
This function is similar to file(), except that file_get_contents() returns the file in a string, starting at the specified offset up to maxlen bytes. On failure, file_get_contents() will return FALSE.
Q: How will you convert the returned API into an XML object?
A. SimpleElement()
B. SimpleXMLElement()
C. XMLElement()
D. CovertXML()
Solution: file_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance performance. The API returned by the method file_get_contents() can be converted into an XML object using the method SimpleXMLElement().
Q: Which tag can handle mouse events in Netscape?
A. img
B. a
C. br
D. src
Solution: Netscape is a brand name associated with the development of the Netscape web browser. The img element can handle mouse events in Netscape.
Q: What is the tainted property of the window object?
A. Pathname
B. Protocol
C. Default status
D. Host
Solution: The Defaultstatus is the tainted property of the window object. The defaultStatus property sets or returns the default text in the status bar at the bottom of the browser (the text will be displayed when the page loads).
Q: Which environment variable must the user enable in order to enable data tainting?
A. ENABLE_TAINT
B. MS_ENABLE_TAINT
C. NS_ENABLE_TAINT
D. ENABLE_TAINT_NS
Solution: Data Tainting (or Taint Checking) is a language feature wherein user-input data is flagged as tainted, a flag that propagates to all data derived from this input. The environment variable NS_ENABLE_TAINT must be enabled in order to enable data tainting.

You Have Score    /10